<div id="content_header">
  <h3>Editing</h3>
</div>

<div class="row">
  <div class="col-md-6 col-lg-4">
    <form name="courseForm" role="form" ng-submit="updateCourse()">

      <div class="form-group">
        <label for="Code">
          Code
        </label>
        <span class="error" ng-show="courseForm.Code.$error.required">Required!</span>
        <input type="text" name="Code" class="form-control" id="Code" placeholder="Input field" ng-model="currentCourse.Code" required>
      </div>

      <div class="form-group">
        <label for="CourseName">
          Course Name
        </label>
        <span class="error" ng-show="courseForm.CourseName.$error.required">Required!</span>
        <input type="text" name="CourseName" class="form-control" id="CourseName" placeholder="Input field" ng-model="currentCourse.CourseName" required>
      </div>

      <div class="form-group">
        <label for="CourseTypeId">
          Course Type
        </label>
        <select name="CourseTypeId" class="form-control" id="CourseTypeId" ng-model="currentCourse.CourseTypeId" ng-options="coursetype.CourseTypeId as coursetype.Code +' - '+ coursetype.CourseName for coursetype in coursetypes" required>
          <option value="" ng-hide="currentCourse.CourseTypeId">Select a Course Type.</option>
        </select>
      </div>

      <div class="form-group">
        <label for="CurrencyId">
          Currencies
        </label>
        <select name="CurrencyId" class="form-control" id="CurrencyId" ng-model="currentCourse.CurrencyId" ng-options="currency.CurrencyId as currency.Code +' - '+ currency.CurrencyName for currency in currencies" ng-change="calculate(currentCourse.Fee, currentCourse.CurrencyId)"required>
          <option value="" ng-hide="currentCourse.CurrencyId">Select a Currency.</option>
        </select>
      </div>

      <div class="form-group">
        <label for="Fee">
          Fee
        </label>
        <span class="error" ng-show="courseForm.Fee.$error.required">Required!</span>
        <input type="number" name="Fee" class="form-control" id="Fee" placeholder="Input field" ng-model="currentCourse.Fee" min="1" max="10000000000000" step="1" ng-change="calculate(currentCourse.Fee, currentCourse.CurrencyId)" required>
        <small>{{ currentCourse.Fee | currency: currencies[currentCourse.CurrencyId].CurrencyCode+' ' }} <span ng-show="conversionResult"><i class="simple-icon-arrow-right"></i> {{ conversionResult }}</span></small>
      </div>

      <button type="submit" class="btn btn-primary" >Submit</button>
    </form>
    
  </div>
</div>